package com.demo.jingxi.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.demo.jingxi.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT\n" +
            "    b.role_name\n" +
            "    FROM x_user_role a,x_role b\n" +
            "    WHERE a.`user_id` = #{userId}\n" +
            "    AND a.`role_id` = b.`role_id`")
    List<String> getRoleNamesByUserId(Integer id);
}
